<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>相亲信息管理</title>
<link rel="stylesheet" href="../lib/layui/css/layui.css">
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">相亲信息管理</div>
		</div>

		<div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="xinxichaxun.html">信息</a>
          <dl class="layui-nav-child">
            <dd><a href="ceshi.html">查询信息</a></dd>
            <dd><a href="xinxichaxun.html">用户信息</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="zhuyechaxun.html">公司信息</a>
          <dl class="layui-nav-child">
            <dd><a href="zhuyechaxun.html">公司信息</a></dd>
            <dd><a href="zhuyetianjia.html">添加信息</a></dd>
             <dd><a href="zhuyebianji.html">编辑公司信息</a></dd>
         </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="chaxuncity.html">城市</a>
          <dl class="layui-nav-child">
            <dd><a href="chaxuncity.html">城市信息</a></dd>
            <dd><a href="Addcity.html">添加城市</a></dd>   
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;">婚恋顾问</a>
          <dl class="layui-nav-child">
            <dd><a href="guwen.html">顾问信息</a></dd>
             <dd><a href="guwen编辑.html">编辑顾问信息</a></dd>
              <dd><a href="guwen添加.html">添加顾问信息</a></dd>
         </dl>
        </li>
      </ul>
    </div>
  </div>
		<div class="layui-body" id="neirong">
			<form class="layui-form">
				<!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
				<div class="layui-form-item">
					<label class="layui-form-label">城市</label>
					<div class="layui-input-block">
						<input type="text" name="city" placeholder="请输入添加的城市"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="sub">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
				<!-- 更多表单结构排版请移步文档左侧【页面元素-表单】一项阅览 -->
			</form>
		</div>

		<div class="layui-footer">
			<!-- 底部固定区域 -->
			© HongNiangNiang6.com - 底部固定区域
		</div>
	</div>
	<script src="../lib/layui/layui.js"></script>
	<script src="../lib/js/jquery-1.8.2.js"></script>
	<script>
	
		//JavaScript代码区域	
		layui.use([ 'form', 'layer', 'upload' ], function() {
			var form = layui.form;
			var layer = layui.layer;
			var upload = layui.upload;
			var $ = layui.$;	
			form.on('submit(sub)', function(data){
				  console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
				  $.ajax({
					  url:"../addcity",
					  type:"get",
					  data:data.field,
					  success:function(res){
						  if(res.code==0){
							  layer.msg("添加成功");
							  
						  }else{
							  layer.msg("添加失败");
						  }
						  
					  },
					  dataType:"json"
				  });
				  return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
				});
		});
	</script>
</body>
</html>